import Vue from 'vue';
import VueRouter from 'vue-router';
import Layout from '@/views/LayOut/index.vue';

Vue.use(VueRouter);

const routes = [
  {
    path: '/users',
    name: 'users',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'usersIndex',
        component: () => import(/* webpackChunkName: "about" */ '../views/Users/index.vue'),
      },
      {
        path: 'add',
        name: 'usersAdd',
        component: () => import(/* webpackChunkName: "about" */ '../views/Users/add.vue'),
      },
      {
        path: 'edit/:id',
        name: 'usersEdit',
        component: () => import(/* webpackChunkName: "about" */ '../views/Users/edit.vue'),
        props: true,
      },
    ],
  },
  {
    path: '/classes',
    name: 'classes',
    component: Layout,
    children: [
      {
        path: 'index',
        name: 'classesIndex',
        component: () => import(/* webpackChunkName: "about" */ '../views/Classes/classesIndex.vue'),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
